package cn.cyh.queue_service.mapper;

import cn.cyh.queue_service.model.entity.ServiceType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 业务类型Mapper接口
 */
@Mapper
public interface ServiceTypeMapper extends BaseMapper<ServiceType> {
    
    /**
     * 获取启用状态的业务类型列表
     * 
     * @return 业务类型列表
     */
    @Select("SELECT * FROM biz_service_type WHERE status = 1")
    List<ServiceType> selectActiveTypes();
    
    /**
     * 根据前缀查询业务类型
     * 
     * @param prefix 前缀
     * @return 业务类型
     */
    @Select("SELECT * FROM biz_service_type WHERE prefix = #{prefix} LIMIT 1")
    ServiceType selectByPrefix(@Param("prefix") String prefix);
}